import request from '@/utils/request'

const api_name = '/admin/role'

export default {

    getPageList(searchObj) {
        return request({
            url: `${api_name}/page`,
            method: 'get', 
            params: searchObj
        })
    },
    createRole(role) {
        return request({
            url: `${api_name}/save`,
            method: 'post',
            data: role
        })
    },
    getRole(id) {
        return request({
            url: `${api_name}/info/${id}`,
            method: 'get'
        })
    },
    updateRole(role) {
        return request({
            url: `${api_name}/update`,
            method: 'put',
            data: role
        })
    },
    removeRole(id) {
        return request({
            url: `${api_name}/delete/${id}`,
            method: 'delete'
        })
    }
}